<template>
  <div class="container">
    <!--头部导航栏-->
    <index-header :classify="classify" />
    <div class="router-container">
      <router-view />
    </div>
  </div>
</template>

<script>
import IndexHeader from './component/IndexHeader'
import defaultSetting from '@/settings'
import { getCourseType } from '@/api/course'

export default {
  name: 'FrontLayout',
  components: { IndexHeader },
  data() {
    return {
      classify: [],
      list: [],
      // 总数
      total: 0,
      // 加载标志
      loading: true,
      // 查询对象
      listQuery: {
        current: 1,
        size: 20,
        key: ''
      },
      defaultSetting
    }
  },
  created() {
    this.getCourseType()
  },
  methods: {
    // 获取课程分类
    getCourseType() {
      // defaultSetting.fileUrl + course.rotationList[0].url + '/' + course.rotationList[0].code
      getCourseType().then(res => {
        const type = res.data.filter((itme, index) => {
          return index <= 6
        })
        type.unshift('精选')
        this.classify = type
        this.$store.commit('course/SET_TYPELIST', type)
        this.loading = false
      }).catch(() => {
        this.loading = false
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.container {
  min-height: 100%;
  min-width: 1300px;
  max-width: 1920px;
  background-color: #F4F4F4;
}
.router-container {
  padding: 10px 180px 0;
}
</style>
